using System;
using System.Collections.Generic;
using System.Text;

namespace Toenda.Foundation.Globalization.Holiday {
	/// <summary>
	/// Implements a holiday date object
	/// </summary>
	public class Holiday : IComparable<Holiday> {
		private bool _isFix;
		private DateTime _date;
		private string _name;

		/// <summary>
		/// Creates a new instance of <see cref="Holiday"/>
		/// </summary>
		/// <param name="isFix"></param>
		/// <param name="datum"></param>
		/// <param name="name"></param>
		public Holiday(bool isFix, DateTime datum, string name) {
			this._isFix = isFix;
			this._date = datum;
			this._name = name;
		}

		/// <summary>
		/// Get or set the name
		/// </summary>
		public string Name {
			get { return this._name; }
			set { this._name = value; }
		}

		/// <summary>
		/// Get or set the date
		/// </summary>
		public DateTime Date {
			get { return this._date; }
			set { this._date = value; }
		}

		/// <summary>
		/// Get or set a value that indicates if this holiday is a fixed holiday
		/// </summary>
		public bool IsFix {
			get { return this._isFix; }
			set { this._isFix = value; }
		}

		#region IComparable<Holiday> Member

		/// <summary>
		/// Compare this holiday with the holiday parameter
		/// </summary>
		/// <param name="other"></param>
		/// <returns></returns>
		public int CompareTo(Holiday other) {
			return this._date.Date.CompareTo(other.Date.Date);
		}

		#endregion
	}
}
